
public class InstructionMemory {
	private int[] instruction;
	private int[][] jumpSuccess;
	
	public InstructionMemory(){
		this.instruction=new int[1024];
		this.jumpSuccess=new int[1024][2];
		for(int i=0;i<1024;i++){
			for(int j=0;j<2;j++)
				this.jumpSuccess[i][j]=0;
		}
		this.setInstruction(0, 536936449);
		this.setInstruction(4, 537001985);
		this.setInstruction(8, 537133066);
		this.setInstruction(12, 2234400);
		this.setInstruction(16, 133152);
		this.setInstruction(20, 200736);
		this.setInstruction(24, 545587199);
		this.setInstruction(28, 0x1480fff0);
		this.setInstruction(32, -67108864);
	}
	
	public void setInstruction(int pc,int inst){
		this.instruction[pc/4]=inst;
	}
	
	public int getInstruction(int pc){
		return this.instruction[pc/4];
	}
	
	public boolean whetherJump(int pc){
		boolean succ=false;
		for(int i=0;i<2;i++){
			if(this.jumpSuccess[pc/4][i]==1){
				succ=true;
				break;
			}
		}
		return succ;
	}
}
